<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

	<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
	
	<!-- Enables the Spring MVC @Controller programming model -->
    <annotation-driven>
  		<message-converters register-defaults="true">
    		<beans:bean class="org.springframework.http.converter.StringHttpMessageConverter">
      			<beans:property name="supportedMediaTypes" value = "text/plain;charset=UTF-8" />
    		</beans:bean>
  		</message-converters>
	</annotation-driven>
	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
	<resources mapping="/resources/**" location="/resources/" />


	<!--
	 <beans:bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
           <beans:property name="classesToBeBound">
                <beans:list>
                    <beans:value>com.homeinns.model.Employee</beans:value>
                    <beans:value>com.homeinns.model.EmployeeList</beans:value>
                </beans:list>
            </beans:property>
     </beans:bean>
      -->

	 
	<beans:bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
		<beans:property name="order" value="1"></beans:property>
		<beans:property name="ignoreAcceptHeader" value="true"/>  
		<beans:property name="defaultContentType" value="text/html"/>  
	
		<beans:property name="mediaTypes">
		    <beans:map>
		        <beans:entry key="xml" value="application/xml"/>
		        <beans:entry key="html" value="text/html"/>
		    </beans:map>
		</beans:property>
		
		<beans:property name="favorParameter" value="false"></beans:property>
		
		<beans:property name="defaultViews">
			<beans:list>
				<beans:bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
				<beans:bean class="org.springframework.web.servlet.view.xml.MarshallingView">   
                     <beans:constructor-arg ref="jaxbMarshaller"></beans:constructor-arg>
                </beans:bean>
			</beans:list>
		</beans:property>
	</beans:bean>
	
	<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
	<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<beans:property name="order" value="2"></beans:property>
		<beans:property name="prefix" value="/WEB-INF/views/" />
		<beans:property name="suffix" value=".jsp" />
	</beans:bean>
	
	
	<context:component-scan base-package="com.homeinns.crs" />
	
	
	
</beans:beans>
